package com.atguigu.rabbitmq.eight;

import com.atguigu.rabbitmq.utils.RabbitMqutils;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DeliverCallback;

import java.util.HashMap;
import java.util.Map;

/**
 * 死信队列
 * 消费者 1
 * 大小写切换 ctrl+shirft+u
 */
public class Consumer02 {

    //死信队列的名称
    public static final String DEAD_QUEUE = "dead_queue";


    public static void main(String[] args) throws Exception {
        Channel channel = RabbitMqutils.getChannel();

        System.out.println("等待接收消息.......");

        DeliverCallback deliverCallback = (var1, var2) -> {
            System.out.println("Consumer02" + new String(var2.getBody(), "utf-8"));
        };
        channel.basicConsume(DEAD_QUEUE, true, deliverCallback, var1 -> {
        });

    }


}
